package com.mingqijia.gassafety.db.mapper;

import com.mingqijia.gassafety.db.entity.Consumer;
import com.mingqijia.gassafety.db.entity.WarnStrategy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报警策略 Mapper 接口
 * </p>
 *
 * @author zhangfei
 * @since 2022-02-25
 */
@Mapper
@Repository
public interface WarnStrategyMapper extends BaseMapper<WarnStrategy> {

    List<WarnStrategy> selectListByCondition(@Param("warnStrategy") WarnStrategy warnStrategy,
                                             @Param("splits")List<String> splits);

    void updateByIds(@Param("ids")List<String> ids,@Param("type")int type,@Param("opt")int opt);

    List<WarnStrategy> selectByIdStrategyObjValues(@Param("spId")String spId,@Param("array") String[] array,
                                                   @Param("strategyObj")Integer strategyObj,
   @Param("id") Long id);

    WarnStrategy selectWarnStrategy(@Param("consumerId")Integer consumerId, @Param("Industry")String Industry);


    Consumer selectIndustry(@Param("consumerId")Integer consumerId,@Param("iMEI")Object iMEI);

    Consumer selectConsumerAndIndustry(@Param("iMEI")Object iMEI);

    WarnStrategy selectWarnStrategyById(@Param("id")Long id);
    List<WarnStrategy> checkStrategies(@Param("spId")String spId);
}
